﻿using Common;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TempCtr
{
    public partial class RegistForm : Form
    {
        public RegistForm()
        {
            InitializeComponent();
        }
        private void RegistForm_Load(object sender, EventArgs e)
        {
            textBox1.Text = MainFrom.md5key;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                RegistFileHelper.WriteRegistFile(textBox2.Text);

                if (RegistFileHelper.CheckRegistData(MainFrom.md5key) == true)
                {
                    MessageBox.Show("注册成功～");
                    //MainFrom.Logger.Info("***********注册成功***********");
                    MainFrom.isRegist = true;
                    this.Close();
                }
                else
                {
                    //MainFrom.Logger.Info("***********注册失败***********");
                    MainFrom.isRegist = false;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                MainFrom.isRegist = false;
            }

        }
    }
}
